//
//  CommentTableViewCell.m
//  DanTang
//
//  Created by honeyrr on 2017/9/26.
//  Copyright © 2017年 honeyrr. All rights reserved.
//

#import "CommentTableViewCell.h"
#import "NSDate+MRExtension.h"

@interface CommentTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *userImage;
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UILabel *userContent;
@property (weak, nonatomic) IBOutlet UILabel *userTime;

@end

@implementation CommentTableViewCell

-(void)setComment:(NSDictionary *)comment
{
    _comment = comment;
    NSString *url = comment[@"avatar_url"];
    [self.userImage sd_setImageWithURL:[NSURL URLWithString:url]];
    self.userName.text = comment[@"nickname"];
    self.userContent.text = comment[@"content"];
    self.userTime.text = [NSDate dateWithTimeStamp:comment[@"created_at"]];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
